package com.example.demo.Master;

/**
 * 进行心跳检测的线程
 * @author xyt
 */
public class HeartBeatThread extends Thread{
  private MasterBase masterBase;

  public HeartBeatThread(MasterBase masterBase){
    this.masterBase = masterBase;
  }

  @Override
  public void run(){
    while (true){
      try {
        Thread.sleep(30000);
        masterBase.heartBeat();

      } catch (InterruptedException e) {
        e.printStackTrace();
        break;
      }
    }
  }
}
